﻿using Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Remoting.Messaging;
using System.Text;
using System.Threading.Tasks;

namespace DAL
{
    public class DbContextFactory
    {
        public static CodeFirstTestMvcDBEntities getDbContext()
        {
            CodeFirstTestMvcDBEntities mydb = (CodeFirstTestMvcDBEntities)CallContext.GetData("mydb");
            if (mydb == null)
            {
                mydb = new CodeFirstTestMvcDBEntities();
                CallContext.SetData("mydb", mydb);
            }
            return mydb;
        }
    }
}
